<template>
  <div class="confirm-anOrder">
    <div class="orderForm-header">
      <span class="left_icon fa fa-2x fa-angle-left returnLeave" @click="returnLeave"></span>
      <span class="trolleyTitle">确认订单</span>
    </div>
    <div class="orderForm-bodyer">
      <div class="detailedAdd">
        <img class="location" src="../../assets/定位.png"/>
        <span class="userName">{{addressArr.receiver}}</span>
        <span class="userPhone">{{addressArr.phoneNumber}}</span>
        <span class="userLocation">{{addressArr.location}}</span>
            <span class="left_icon fa fa-2x fa-angle-right modAddress"></span>
      </div>
      <div>
        <ul>
          <li class="merchandiseNews">
            <div class=" commodityImg"></div>
            <span class="chaseQuantity ">共1件</span>
            <span class="left_icon fa fa-1x fa-angle-right chaseBtn"></span>
          </li>
        </ul>
      </div>
      <div class="modePayment">
        <p>支付方式<span>在线支付</span></p>
        <p>最高可优惠金额<span>30元</span></p>
        <p>实际优惠金额<span>无可用</span></p>
      </div>
      <div class="amountGoods">
        <p>商品金额<span class="money">￥59.9</span></p>
        <p>运费<span class="sum">￥0</span></p>
      </div>
      <div class="aggregate">合计: <span>￥59.9</span></div>
      <div class="confirmBtn">立即下单</div>
    </div>
  </div>
</template>

<script>
  export default {
    name: 'confirm-anOrder',
    data() {
      return {
        addressArr: [],
      }
    },
    methods: {
      returnLeave() {
        this.$router.go(-1);
      }
    },
    created() {
      this.$request.getAddr()
        .then((res) => {
          console.log(res);
          res.data.data.filter(value => {
            if (value.isDefault === true) {
              this.addressArr = value;
            }
          })
        })
        .catch((error) => console.log(error));
    }
  };
</script>

<style scoped>
  *{
    margin: 0;
    padding: 0;
  }
  .confirm-anOrder{
    background: #f0eff5;
    width: 100vw;
    height: 92.2vh;
  }
  .orderForm-header{
    height: 80px;
    line-height: 80px;
    text-align: center;
    width: 100vw;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 999;
    background: #fff;
    border-bottom: 1px solid #d7d7d7;
  }
  .returnLeave{
    position: absolute;
    top: 15px;
    left: 20px;
  }
  .orderForm-bodyer{
    margin-top: 81px;
    width: 100vw;
  }
  .detailedAdd{
    width: 100vw;
    height: 140px;
    background: #fff;
    position: relative;
    border-bottom: 6px dashed #579cf6;
  }
  .location{
    position: absolute;
    top: 50px;
    left: 15px;
    width: 35px;
  }
  .userName{
    position: absolute;
    top: 20px;
    left: 70px;
  }
  .userPhone{
    position: absolute;
    top: 20px;
    right: 60px;
  }
  .userLocation{
    position: absolute;
    top: 80px;
    left: 70px;
    font-size: 25px;
    color: #6a6a6a;
  }
  .modAddress{
    position: absolute;
    top: 50px;
    right: 30px;
    font-size: 35px;
    color: #d2d5d7;
  }
  .merchandiseNews{
    width: 100vw;
    height: 200px;
    background: #fff;
    position: relative;
    /*border-bottom: 1px solid #cccccc;*/
  }
  .commodityImg{
    width: 160px;
    height: 160px;
    background: #63a35c;
    position: absolute;
    top: 20px;
    left: 20px;
  }
  .chaseQuantity{
    position: absolute;
    top: 90px;
    right: 60px;
    color: #646464;
  }
  .chaseBtn{
    position: absolute;
    top: 85px;
    right: 30px;
    font-size: 35px;
    color: #d8dbdb;
  }
  .modePayment{
    margin-top: 10px;
    width: 100vw;
    height: 225px;
    overflow: hidden;
    background: #fff;
  }
  .modePayment>p{
    height: 75px;
    line-height: 75px;
    padding-left: 30px;
    font-size: 24px;
    color: #6c6c6c;
    position: relative;
  }
  .modePayment>p>span{
    position: absolute;
    top: 0;
    right: 50px;
    color: #262626;
  }
  .amountGoods{
    margin-top: 5px;
    width: 100vw;
    height: 150px;
    background: #fff;
    overflow: hidden;
  }
  .amountGoods>p{
    height: 75px;
    line-height: 75px;
    padding-left: 30px;
    position: relative;
    color: #6c6c6c;
  }
  .amountGoods>p>span{
    position: absolute;
    top: 0;
    right: 50px;
  }
  .sum{
    color: #e8451f;
  }
  .money{
    color: #262626;
  }
  .aggregate{
    margin-top: 10px;
    height: 75px;
    line-height: 75px;
    padding-right: 50px;
    text-align: right;
    background: #fff;
    color: #6c6c6c;
  }
  .aggregate>span{
    color: #e8451f;
  }
  .confirmBtn{
    height: 80px;
    line-height: 80px;
    width: 100vw;
    text-align: center;
    color: #fff;
    background: #579cf6;
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 999;
  }
</style>
